int I1 = 4;
int I2 = 7;
int pwm = 5;
int rSW = 8;
int lSW = 9;

void setup(){
  Serial.begin(9600);
  
  
  pinMode(I1, OUTPUT);
  pinMode(I2, OUTPUT);
}

void loop(){
  analogWrite(pwm,5);
  //Serial.println(pwm);
  digitalRead(rSW);
  digitalRead(lSW);
 if(rSW == HIGH){
   
    digitalWrite(I1,LOW);
    digitalWrite(I2,HIGH);
  }
  else{
    digitalWrite(I1,HIGH);
    digitalWrite(I2,LOW);
  }
}
